<%--
  Created by IntelliJ IDEA.
  User: kz
  Date: 2017/8/7
  Time: 8:34
  To change this template use File | Settings | File Templates.
--%>

<%
    String path = request.getContextPath();

    String basePath = request.getScheme() + "://" + request.getServerName() + ":"

            + request.getServerPort() + path + "/";
%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>ExtJs</title>
    <link href="<%=basePath%>resources/ExtJs/resources/css/ext-all.css" rel="stylesheet" type="text/css"/>
    <link href="/resources/ExtJs/resources/ext-theme-gray/ext-theme-gray-all.css" rel="stylesheet" type="text/css"/>
    <script src="<%=basePath%>resources/ExtJs/ext-all-debug-w-comments.js" type="text/javascript"></script>
    <!-- <script src="ExtJs/ext-all.js" type="text/javascript"></script> -->
    <script src="<%=basePath%>resources/ExtJs/ext-lang-zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript">
        Ext.onReady(function () {
            //创建一个窗体
            var win = new Ext.Window({
                width: 800,
                height: 500,
                left: 10,
                top: 10,
                items: [],
                modal: true,
                buttonAlign: 'center',
                buttons: [{
                    text: '测试', id: 'btnTest', handler: function () {
                        Ext.Msg.show({
                            title: '询问',
                            msg: '您喜欢 ExtJs 吗？',
                            fn: processResult,
                            icon: Ext.Msg.QUESTION,
                            buttons: Ext.Msg.YESNO
                        });
                    }
                }
                ]
            });
            win.show();
        });

        //询问对话框处理Handler
        function processResult(btn) {
            Ext.Msg.alert('结果', btn);
        }
    </script>
</head>
<body>
<div>
</div>
</body>
</html>